﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<HomeService.Models.ServiceRequest>" %>

<asp:Content ContentPlaceHolderID="TitleContent" runat="server">
	Vahvista huoltopyyntö
</asp:Content>

<asp:Content ContentPlaceHolderID="MainContent" runat="server">

	<p>1. <%: Html.ActionLink("Täytä perustiedot", "AddBasicInfo") %> → 2. <%: Html.ActionLink("Liitä valokuvia", "AddPhotos") %> → <strong>3. Vahvista</strong></p>

    <h2>Vahvista huoltopyyntö</h2>

	<% using (Html.BeginForm("SendRequest", "ServiceRequest")) { %>
		
		<%: Html.ValidationSummary() %>

		<h3>Perustiedot</h3>
		<div>
			<label><%: Html.DisplayNameFor(x => x.BasicInfo.Name) %>:</label>
			<div><%: Model.BasicInfo.Name %></div>
		</div>

		<div>
			<label><%: Html.DisplayNameFor(x => x.BasicInfo.Address) %>:</label>
			<div><%= Html.EncodeAndAddLineBreaks(Model.BasicInfo.Address) %></div>
		</div>

		<div>
			<label><%: Html.DisplayNameFor(x => x.BasicInfo.Phone) %>:</label>
			<div><%= Html.EncodeAndAddLineBreaks(Model.BasicInfo.Phone) %></div>
		</div>

		<div>
			<label><%: Html.DisplayNameFor(x => x.BasicInfo.Email) %>:</label>
			<div><%= Html.EncodeAndAddLineBreaks(Model.BasicInfo.Email) %></div>
		</div>

		<div>
			<label><%: Html.DisplayNameFor(x => x.BasicInfo.Description) %>:</label>
			<div><%= Html.EncodeAndAddLineBreaks(Model.BasicInfo.Description) %></div>
		</div>

		<h3>Valokuvat</h3>

		<% foreach (var photo in Model.Photos) { %>
			<%: Html.Partial("Photo/ViewPhoto", photo) %>
		<% } %>
	
		<div id="actions">
			<%: Html.ActionLink("Takaisin", "AddPhotos") %>
			<input type="submit" value="Lähetä" />
		</div>

	<% } %>
	

</asp:Content>